package com.wuyou.designPatterns.interpreter;


import com.zaxxer.hikari.util.ConcurrentBag;

/**
 * @Description <repeat command> ::= repeat <number> <command list>
 * @Author 无忧
 * @Date 2024/10/20 21:55
 */
public class RepeatCommandNode extends Node{

    private int number;
    private Node commandListNode;

    @Override
    public void parse(Context context) throws ParseException {
        context.skipToken("repeat");
        number = context.currentNumber();
        context.nextToken();
        commandListNode = new CommandListNode();
        commandListNode.parse(context);
    }

    public String toString(){
        return "[repeat " + number + " " + commandListNode + "]";
    }
}
